From: Dario Faggioli Date: Fri, 18 Mar 2016 17:32:50 +0000 (+0100) Subject: xen: sched: on credit2, don't reprogram the timer if idle X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1331 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2c6f317a2bc34cd06d00af39d40fd31fb9d52863;p=xen.git xen: sched: on credit2, don't reprogram the timer if idle As other schedulers are doing already: if the idle vcpu is picked and scheduled, there is no need to reprogram the scheduler timer to fire and invoke csched2_schedule() again in future. Tickling or external events will serve as pokes, when necessary, but until we can, we should just stay idle. Signed-off-by: Dario Faggioli Reported-by: Tianyang Chen Suggested-by: George Dunlap Acked-by: George Dunlap --- diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 7286e5061b..b207d8491a 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -1543,8 +1543,12 @@ csched2_runtime(const struct scheduler *ops, int cpu, struct csched2_vcpu *snext struct csched2_runqueue_data *rqd = RQD(ops, cpu); struct list_head *runq = &rqd->runq; + /* + * If we're idle, just stay so. Others (or external events) + * will poke us when necessary. + */ if ( is_idle_vcpu(snext->vcpu) ) - return CSCHED2_MAX_TIMER; + return -1; /* General algorithm: * 1) Run until snext's credit will be 0